Typically, a digital camera captures image data in frames comprising active video data, line balancing data, and frame blanking data. The start and end of a frame, and the start and end of a line of active video data, is signified by a flag byte to allow synchronization of the contents lines and frames of active video data. Typical values of these flag bytes are shown in table 1.
TABLE 1Detect 00H in JPEGByte n-2Byte n-1Byte nXXXXXXXX11111111000000001XXXXXXX011111110000000011XXXXXX0011111100000000111XXXXX00011111000000001111XXXX000011110000000011111XXX0000011100000000111111XX00000011000000001111111X0000000100000000
It is possible for a series of bits to correspond to one of these flags by chance. A co-processor associated with the camera scans the serially imput frame data for data corresponding, or nearly corresponding, to these flags and inserts a padding byte after the bytes of the flag in order to prevent a reset of the frame at an incorrect point. In JPEG-8 this padding is typically “A5.” The insertion of the padding byte prevents the completion of a start or end flag sequence.
However, the padding bytes disrupt the structure of the active video data file. For example, a standard VGA image is 640×480 pixels. After insertion of padding bytes, certain rows may now appear to be longer than 640 pixels. Therefore, the padding bytes may be removed from the active video data frame prior to display. Typically, in mobile telephones and other video display equipment, this is achieved by the stripping of the padding bytes from active video data using software. The use of software to strip the padding bytes delays the processing of the active video data.
The effect of the high software overhead associated with this process is that the rate of display of frames is reduced compared to a rate of image capture. For example, using a camera with a 30 frame per second (fps) capture rate for VGA that uses software processing on the image data, a display rate of approximately 7.5 fps is achievable.
The serialization of video data output from an encoder also causes a difficulty in that serialization can occur at any point within a byte due to imperfect synchronization between the encoder and decoder. This makes it possible that the flag bytes are not encoded perfectly, for example, FF 02 may appear as FE 01 due to imperfect serialization. This can result in bit shifting of image data. Accordingly, possible combinations of these bytes that can correspond to imperfect serialization of FF 02 may be checked for, further increasing software overhead.